﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DFGK_WMS.Context.Migrations
{
    public partial class 徐州入库新增字段 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "TAreas");

            migrationBuilder.DropTable(
                name: "TRouteways");

            migrationBuilder.DropColumn(
                name: "Articlebarcode",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "Shortname",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "Tonnagefactor",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "MengNiuEmphasis",
                table: "TCustomers");

            migrationBuilder.DropColumn(
                name: "MengNiuStatus",
                table: "TCustomers");

            migrationBuilder.DropColumn(
                name: "Postcode",
                table: "TCustomers");

            migrationBuilder.DropColumn(
                name: "Shortname",
                table: "TCustomers");

            migrationBuilder.AddColumn<string>(
                name: "Agent",
                table: "TReceivingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "CellName",
                table: "TReceivingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "MakerialCategoryId",
                table: "TReceivingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "MakerialCategoryName",
                table: "TReceivingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ModelSpec",
                table: "TReceivingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<bool>(
                name: "InventoryDifferences",
                table: "TInventories",
                type: "bit",
                nullable: false,
                defaultValue: false);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Agent",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "CellName",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "MakerialCategoryId",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "MakerialCategoryName",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "ModelSpec",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "InventoryDifferences",
                table: "TInventories");

            migrationBuilder.AddColumn<string>(
                name: "Articlebarcode",
                table: "TMaterials",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "Shortname",
                table: "TMaterials",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Tonnagefactor",
                table: "TMaterials",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<bool>(
                name: "MengNiuEmphasis",
                table: "TCustomers",
                type: "bit",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<bool>(
                name: "MengNiuStatus",
                table: "TCustomers",
                type: "bit",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<string>(
                name: "Postcode",
                table: "TCustomers",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "Shortname",
                table: "TCustomers",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true);

            migrationBuilder.CreateTable(
                name: "TAreas",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BuiltArea = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    Erpcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsRealArea = table.Column<bool>(type: "bit", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ShelfCount = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    TypeId = table.Column<int>(type: "int", nullable: false),
                    TypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhId = table.Column<int>(type: "int", nullable: false),
                    WhName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TAreas", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TRouteways",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Number = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    WhCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhId = table.Column<int>(type: "int", nullable: false),
                    WhName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TRouteways", x => x.Id);
                });
        }
    }
}
